package com.example.validate;

import java.sql.*;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.sun.appserv.jdbc.DataSource;

public class ConnectionManager {

   static Connection con;
   static String url;
         
   public static Connection getConnection(){
	   DataSource ds = null;
       InitialContext ctx = null;
      try{
         	ctx = new InitialContext();
     		ds = (DataSource) ctx.lookup("jdbc/lut2");
         try{            	
        	 con = ds.getConnection(); 
         }catch (SQLException ex){
            ex.printStackTrace();
         }
      }catch (NamingException e) {
		e.printStackTrace();
	}

   return con;
   }
}
